/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cassoftViews;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.JTextField;

/**
 *
 * @author Israel Agyeman-Premp
 */
public class MainView extends javax.swing.JFrame {
    
    //DefaultTableModel transactionTable = new DefaultTableModel();

    /**
     * Creates new form mainView
     */
    public MainView() {
        initComponents();
        this.setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPopupMenu1 = new javax.swing.JPopupMenu();
        jToolBar1 = new javax.swing.JToolBar();
        addStudentBtn = new javax.swing.JButton();
        advancedAddStudent = new javax.swing.JButton();
        viewStudentBtn = new javax.swing.JButton();
        settingsBtn = new javax.swing.JButton();
        summaryBtn = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        amountPaidText = new javax.swing.JTextField();
        studentEditableComboBox = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        categoryComboBox = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        saveBtn = new javax.swing.JButton();
        exitBtn = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        searchBtn = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        mainTable = new javax.swing.JTable();
        searchComboBox = new javax.swing.JComboBox();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jToolBar1.setRollover(true);

        addStudentBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/341.png"))); // NOI18N
        addStudentBtn.setText("Add Student");
        addStudentBtn.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        addStudentBtn.setFocusable(false);
        addStudentBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        addStudentBtn.setIconTextGap(1);
        addStudentBtn.setMaximumSize(new java.awt.Dimension(115, 63));
        addStudentBtn.setMinimumSize(new java.awt.Dimension(115, 63));
        addStudentBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        addStudentBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudentBtnActionPerformed(evt);
            }
        });
        jToolBar1.add(addStudentBtn);

        advancedAddStudent.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/create.png"))); // NOI18N
        advancedAddStudent.setText("Advanced Add");
        advancedAddStudent.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        advancedAddStudent.setFocusable(false);
        advancedAddStudent.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        advancedAddStudent.setIconTextGap(1);
        advancedAddStudent.setMaximumSize(new java.awt.Dimension(115, 63));
        advancedAddStudent.setMinimumSize(new java.awt.Dimension(115, 63));
        advancedAddStudent.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        advancedAddStudent.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                advancedAddStudentActionPerformed(evt);
            }
        });
        jToolBar1.add(advancedAddStudent);

        viewStudentBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/313.png"))); // NOI18N
        viewStudentBtn.setText("View Student");
        viewStudentBtn.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        viewStudentBtn.setFocusable(false);
        viewStudentBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        viewStudentBtn.setIconTextGap(1);
        viewStudentBtn.setMaximumSize(new java.awt.Dimension(115, 63));
        viewStudentBtn.setMinimumSize(new java.awt.Dimension(115, 63));
        viewStudentBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(viewStudentBtn);

        settingsBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/52.png"))); // NOI18N
        settingsBtn.setText("Settings");
        settingsBtn.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        settingsBtn.setFocusable(false);
        settingsBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        settingsBtn.setMaximumSize(new java.awt.Dimension(115, 63));
        settingsBtn.setMinimumSize(new java.awt.Dimension(115, 63));
        settingsBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        settingsBtn.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                settingsBtnMouseEntered(evt);
            }
        });
        settingsBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                settingsBtnActionPerformed(evt);
            }
        });
        jToolBar1.add(settingsBtn);

        summaryBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/230.png"))); // NOI18N
        summaryBtn.setText("Summary");
        summaryBtn.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        summaryBtn.setFocusable(false);
        summaryBtn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        summaryBtn.setMaximumSize(new java.awt.Dimension(115, 63));
        summaryBtn.setMinimumSize(new java.awt.Dimension(115, 63));
        summaryBtn.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(summaryBtn);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
        jLabel1.setText("Enter Transaction");

        studentEditableComboBox.setEditable(true);
        studentEditableComboBox.setFocusCycleRoot(true);
        studentEditableComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                studentEditableComboBoxActionPerformed(evt);
            }
        });

        jLabel2.setText("Student Name");

        jLabel3.setText("Amount Paid");

        categoryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Feeding Fee", "School Fees", "Classes Fee" }));

        jLabel4.setText("Category");

        saveBtn.setText("Save");
        saveBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveBtnActionPerformed(evt);
            }
        });

        exitBtn.setText("Exit");
        exitBtn.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        exitBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(43, 43, 43)
                                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addContainerGap()
                                .addComponent(jLabel2)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(saveBtn, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(categoryComboBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(studentEditableComboBox, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(amountPaidText, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(exitBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel3))
                                .addGap(0, 0, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(studentEditableComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(categoryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(amountPaidText, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(28, 28, 28)
                .addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(exitBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        searchBtn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/241.png"))); // NOI18N

        mainTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(mainTable);

        searchComboBox.setEditable(true);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(searchComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(searchBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 780, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(searchBtn, javax.swing.GroupLayout.DEFAULT_SIZE, 29, Short.MAX_VALUE)
                    .addComponent(searchComboBox))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE))
        );

        jMenu1.setText("File");

        jMenuItem1.setText("Open");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(37, 37, 37)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 12, Short.MAX_VALUE))
        );

        setSize(new java.awt.Dimension(1040, 639));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void studentEditableComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_studentEditableComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_studentEditableComboBoxActionPerformed

    private void advancedAddStudentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advancedAddStudentActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_advancedAddStudentActionPerformed

    private void settingsBtnMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_settingsBtnMouseEntered
        // TODO add your handling code here:
        
    }//GEN-LAST:event_settingsBtnMouseEntered

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
      
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void addStudentBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentBtnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_addStudentBtnActionPerformed

    
    private void exitBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitBtnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_exitBtnActionPerformed

    private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBtnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_saveBtnActionPerformed

    private void amountPaidTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_amountPaidTextActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_amountPaidTextActionPerformed

    private void settingsBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_settingsBtnActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_settingsBtnActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {       

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new MainView().setVisible(true);
            }
        });
    }
    
    public JTextField getAmountPaidField(){
        return amountPaidText;
    }
    
    public JComboBox getCategoryComboBox(){
        return categoryComboBox;
    }
    
    public JComboBox getStudentNameComboBox(){
        return studentEditableComboBox;
    }
    /*
    *A button to add a student
    */
    public JButton getAddStudentBtn(){
        return addStudentBtn;
    }
    
    /*
    *A button to search 
    */
    public JButton getSearchBtn(){
        return searchBtn;
    }
    
    /*
    *A button to exit 
    */
    public JButton getExitBtn(){
        return exitBtn;
    }
    
    /*
    *A button to save 
    */
    public JButton getSaveBtn(){
        return saveBtn;
    }
    
    public JButton getSettingsBtn(){
        return settingsBtn;
    }
   
    
    /*
    *A table for transaction 
    */
    public JTable getTable(){
        return mainTable;
    }
    
    
     /*
    *A table for transaction 
    */
    public JComboBox getSearchComboBox(){
        return searchComboBox;
    }
    
    
    /*
    *A returning the summary button 
    */
    public JButton getSummaryBtn(){
        return summaryBtn;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addStudentBtn;
    private javax.swing.JButton advancedAddStudent;
    private javax.swing.JTextField amountPaidText;
    private javax.swing.JComboBox categoryComboBox;
    private javax.swing.JButton exitBtn;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JTable mainTable;
    private javax.swing.JButton saveBtn;
    private javax.swing.JButton searchBtn;
    private javax.swing.JComboBox searchComboBox;
    private javax.swing.JButton settingsBtn;
    private javax.swing.JComboBox studentEditableComboBox;
    private javax.swing.JButton summaryBtn;
    private javax.swing.JButton viewStudentBtn;
    // End of variables declaration//GEN-END:variables
}
